/**
* 
* 文字进度
* @author 
* 
*/ 
class LoadingUI extends egret.Sprite {

    public constructor() {
        super();
        this.createView();
    }

    private textField:egret.TextField;
    private bar: egret.Shape
    private barMask: egret.Shape;
    private barWidth: number = 600;
    
    private createView():void {
        let stageW = egret.MainContext.instance.stage.stageWidth;

        let textField = new egret.TextField();
        textField.y = 300;
        textField.width = stageW;
        textField.height = 100;
        textField.textAlign = "center";
        this.addChild(textField);
        
        this.textField = textField
    }

    public setProgress(current, total):void {
        this.textField.text = Math.floor(current*100/total) + "%";

        // this.barMask.width = this.barWidth*(current/total)     
        // this.bar
        // this.barMask.graphics.beginFill( 0x00ff00, 1);   
        // this.barMask.graphics.drawRect( 0, 0, this.barMask.width, this.barMask.height );
        // this.barMask.graphics.endFill();
        
    }
}
